﻿@model MvcPrinciples.Models.Person

@{
    ViewBag.Title = "EditPerson";
    Layout = "~/Views/_CommonLayout.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery-1.10.2.js")"></script>
<script src="@Url.Content("~/Scripts/jquery-ui.js")"></script>
<link type="text/css" href="@Url.Content("~/App_Themes/jquery-ui.css")" rel="stylesheet" />

<div>
	<h2>Add new person:</h2>
	<div>
		@using (Html.BeginForm("EditPersonInList", "Person", FormMethod.Post, new { enctype = "multipart/form-data" }))
		{
			<fieldset>
				<p>Name: <input type="text" name="name" value="@Model.Name" /></p>
				<p>Birth date: <input type="text" id="DatePicker" name="birthDate" value="@Model.BirthDate.ToString("MM/dd/yyyy")" /></p>
				<p>Image: <input type="file" name="imageFile" /></p> 
				<p style="display: none">Id: <input type="text" name="id" value="@Model.Id" /></p>
				<p><input type="submit" value="Submit" /></p>
			</fieldset>
		}
	</div>
</div>

<script type="text/javascript">
	$(function () {
		$("#DatePicker").datepicker();
	});
</script>

